INV OU PL LE

Below query finds out all the Inventory Organization and corresponding Operating Unit, Ledger and Legal Entity.

Select a.organization_id, a.organization_code, a.organization_name,
a.operating_unit, b.name OU, a.set_of_books_id,d.name LEDGER,
a.legal_entity,c.name LE_NAME
From  apps. ORG_ORGANIZATION_DEFINITIONS a,
apps. HR_OPERATING_UNITS b,
apps. xle_entity_profiles c,
apps. gl_ledgers d

Where a.operating_unit=b.organization_id
AND c.legal_entity_id=a.legal_entity
AND d.ledger_id=a.set_of_books_id
 

Modified vesriosn which includes Location details


Select a.organization_id, a.organization_code, a.organization_name, e.Location_code,
e.country, a.operating_unit, b.name OU, a.set_of_books_id,d.name LEDGER,
a.legal_entity,c.name LE_NAME
From  apps. ORG_ORGANIZATION_DEFINITIONS a,
apps. HR_OPERATING_UNITS b,
apps. xle_entity_profiles c,
apps. gl_ledgers d,
apps. HR_LOCATIONS_ALL e

Where a.operating_unit=b.organization_id
AND c.legal_entity_id=a.legal_entity
AND d.ledger_id=a.set_of_books_id
AND e.inventory_organization_id=a.organization_id

The above query will not work

The above query will not work .

there are no table available 1)xle_entity_profiles 2)gl_ledgers

Modified version for 11i

Select a.organization_id, a.organization_code, a.organization_name, e.Location_code,
e.country, a.operating_unit, b.name OU, a.set_of_books_id,d.name LEDGER,
a.legal_entity
From  apps. ORG_ORGANIZATION_DEFINITIONS a,
apps. HR_OPERATING_UNITS b,
--apps. xle_entity_profiles c,
apps. GL_SETS_OF_BOOKS_V  d,
apps. HR_LOCATIONS_ALL e

Where a.operating_unit=b.organization_id
--AND c.legal_entity_id=a.legal_entity
AND d.set_of_books_id=a.set_of_books_id
AND e.inventory_organization_id=a.organization_id
 

for 11i

Select ood.organization_id, ood.business_group_id,aou.name "Business_Group", ood.organization_code, ood.organization_name, ood.operating_unit, ood.set_of_books_id, sob.name "SOB_NAME", sob.currency_code, sob.period_set_name, sob.chart_of_accounts_name, ood.legal_entity from apps. org_organization_definitions ood, apps. HR_OPERATING_UNITS hou , apps. GL_SETS_OF_BOOKS_V sob, apps. HR_ALL_ORGANIZATION_UNITS aou where hou.name LIKE '% %' --OU NAME AND ood.operating_unit= hou.organization_id AND sob.set_of_books_id= ood.set_of_books_id AND ood.business_group_id=aou.organization_id